package com.csdj.thread;


/**
 * 普通叫号
 */
public class CommonThread implements Runnable{

    private Thread specailThread;

    public CommonThread(Thread special){
        this.specailThread = special;
    }
    @Override
    public void run() {
        for(int i=0;i<50;i++){
            if(i == 9){
                try {
                    this.specailThread.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("普通号叫到"+(i+1)+"号");
        }
    }
}
